package swing;



import java.awt.BorderLayout;

import java.awt.FlowLayout;

import java.awt.GridLayout;



import javax.swing.JButton;

import javax.swing.JFrame;



public class Demo1 extends JFrame{



	private static final long serialVersionUID = 1L;

	

	public Demo1() {

		setSize(300, 300);

		setVisible(true);

		setDefaultCloseOperation(EXIT_ON_CLOSE);

		setLayout(new GridLayout(4, 4));

		//setLayout(new FlowLayout());


		/*setLayout(null);


		JButton bt1=new JButton("东");


		bt1.setBounds(30, 50, 100, 25);


		add(bt1);


		JButton bt2=new JButton("中");


		bt2.setSize(50, 25);


		bt2.setLocation(30, 100);


		add(bt2);*/

		for(int i=0;i<10;i++){

			JButton bt=new JButton("按 钮"+(i+1)+"kkk");

			add(bt);

		}        

	}

	

	public static void main(String[] args) {

		new Demo1();

	}



}

